<?php
namespace app\index\controller;

use think\Loader;
use think\Validate;

class Yanzheng extends Validate
{
    protected $rules=[
        'name'=>'requie | max:10',
        'email'=>'eamil'
    ];
}

$data=[
    'name'=>'jiangwei',
    'eamil'=>'1078337851@qq.com',
];

$validate=new Validate('Yanzheng');
$result=$validate->check($data);
if ($result){
    echo "输入正确";
}
else{
    echo "输入错误";
}





//$validate=Loader::validate('Yanzheng');
//if (!$validate->check($data)){
//    dump($validate->getError());
//}
//else{
//    echo "输出正确";
//}




